
//class 的一主三辅
class Pizza(var crustSize: Int, var crustType: String) {

  //class中的辅助构造函数
  def this(crustSize: Int) {
    this(crustSize, Pizza.DEFAULT_CRUST_TYPE)
  }

  //class中的辅助构造函数
  def this(crustType: String) {
    this(Pizza.DEFAULT_CRUST_SIZE, Pizza.DEFAULT_CRUST_TYPE)
  }

  //class中的辅助构造函数
  def this() {
    this(Pizza.DEFAULT_CRUST_SIZE, Pizza.DEFAULT_CRUST_TYPE)
  }

  override def toString = "crustSize : " + crustSize + " crustType : " + crustType

}

object Pizza {

  //参数
  val DEFAULT_CRUST_SIZE = 12

  //参数
  val DEFAULT_CRUST_TYPE = "THIN"


}

object Test extends App {

  //三种建立对象方法
  println(new Pizza().toString)

  println(new Pizza(13))

  println(new Pizza(14, "hehe"))
}